#pragma once

#include "AbstractEntity.h"
#include "InteractiveFactory.h"

/*
@author: TriLVH
@description: interactive system to check and make interactive reponse of 2 or more object
*/

class GameRunInteractive {
public:
	/* Object list map to GameRun object get on quadtree by viewport */
	// list-object

	/* Update interactive system with game time */
	// void update(List-Game-Object, game-time)

	/* Check interactive of list objects */
	// void checkInteractiveObjects(List-Game-Object)

	/* Check interactive of 2 objects */
	void checkInteractive(AbstractEntity* actorOne, AbstractEntity* actorTwo) {
		// Initialize data for interact
		Rect* rectOne = actorOne->getAbstractData()->getRect();
		Rect* rectTwo = actorTwo->getAbstractData()->getRect();
		// Check if 2 object interact together
		if (checkSweptAABB(rectOne, rectTwo)) {
			// Send 2 actors object to interact factory to do somethings with these type of objects
			InteractiveFactory::interactAction(actorOne, actorTwo);
		}
	}

	/* check sweptAABB of 2 objects */
	bool checkSweptAABB(Rect* rectOne, Rect* rectTwo) {
		return true;
	}
};